<div class="row row-cards row-deck">
  <div class="col-12">
    <div class="card">
      <div class="card-header">
        <a href="<%= admin_spu_path(@spu, between: "today") %>" style="margin-right: 20px;" class="btn btn-pill btn-warning">今天</a>
        <a href="<%= admin_spu_path(@spu, between: "by_week") %>" style="margin-right: 20px;" class="btn btn-pill btn-warning">本周</a>
        <a href="<%= admin_spu_path(@spu, between: "by_month") %>" style="margin-right: 20px;" class="btn btn-pill btn-warning">本月</a>
      </div>
      <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
        <thead>
          <tr>
            <th>订单编号</th>
            <th>该项总价</th>
            <th>该项数量</th>
            <th>付款方式</th>
            <th>订单状态</th>
            <th class="text-center">
            </th>
          </tr>
        </thead>
        <tbody>
          <% @order_items.each do |order_item| %>
            <tr>
              <td>
                <div><%= order_item.order.trade_no %></div>
                <div class="small text-muted">
                  <%= formattime(order_item.order.created_at, unit: "hour") %>
                </div>
              </td>
              <td>
                <div><%= order_item.fee * order_item.quantity %></div>
              </td>
              <td>
                <div><%= order_item.quantity %></div>
              </td>
              <td>
                <div><%= i18n_enum order_item.order, :pay_method %></div>
              </td>
              <td>
                <div>
                  <span class="status-icon bg-success"></span>
                  <%= i18n_enum order_item.order, :state %>
                </div>
              </td>
              <td class="text-center">
                <div class="item-action dropdown">
                  <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
                  <div class="dropdown-menu dropdown-menu-right">
                    <a href="<%= admin_order_path(order_item.order) %>" class="dropdown-item"><i class="dropdown-icon fe fe-tag"></i> 查看该订单 </a>
                  </div>
                </div>
              </td>
            </tr>
          <% end %>
        </tbody>
      </table>
      <div class="card-footer">
        <%= paginate @order_items %>
      </div>
    </div>
  </div>
</div>